# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=pulseaudio-ctl
pkgver=1.67
pkgrel=1
pkgdesc="Control pulseaudio volume from the shell or mapped to keyboard shortcuts"
options="!check" # No testsuite
url="https://github.com/graysky2/pulseaudio-ctl"
arch="noarch"
license="MIT"
depends="bash pulseaudio-utils"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/graysky2/pulseaudio-ctl/archive/v$pkgver.tar.gz"

build() {
	make
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
}

zshcomp() {
	depends=""
	pkgdesc="Zsh compltions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh
	mv "$pkgdir"/usr/share/zsh/site-functions "$subpkgdir"/usr/share/zsh
	rmdir -p "$pkgdir"/usr/share/zsh 2>/dev/null || :
}

sha512sums="5ea1cbfd87cf073de46b6fd9953a3c7b9c6969da46103dd5dfc56aa3f179b2ba36ade5db7ca47d204f0f60ac02020f1a4f2dd58bbaf010f9a99780702295418c  pulseaudio-ctl-1.67.tar.gz"
